package com.suyuan.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.suyuan.dao.PermissionMapper;
import com.suyuan.entity.Permission;
import com.suyuan.entity.PermissionExample;
import com.suyuan.service.PermissionService;
import com.suyuan.web.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by yang on 2018/3/6.
 */
@Service(value = "permissionService")
public class PermissionServiceImpl implements PermissionService {

    @Resource
    private PermissionMapper permissionMapper;

    public PageInfo list(Page page) {
        PageHelper.startPage(page.getPageNumber(),page.getPageSize());
        List<Permission> pers = permissionMapper.selectByExample(new PermissionExample());
        PageInfo info = new PageInfo(pers);
        return info;
    }
}
